<<<<<<< HEAD
old_name = 'newline'
new_name = 'testrock'
f_name = open('file_test.txt', 'r' , encoding='utf-8')
f_new = open ("file_newone.txt",'w',encoding='utf-8')
=======
old_name = 'new'
new_name = 'testrock'
f_name = open('test01.txt', 'r' , encoding='utf-8')
f_new = open ("testaaa.txt",'w',encoding='utf-8')
>>>>>>> dev

for line in f_name:
    if old_name in line:
        line = line.replace(old_name, new_name)

    f_new.write(line)

f_name.close()
f_new.close()